﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// ReSharper disable All

namespace ChanTai.WebApi.Data
{
    /// <summary>
    /// 被保人
    /// </summary>
    public class RiskRealatePary:ApiCovent
    {
        /// <summary>
        /// 默认初始化
        /// </summary>
        public RiskRealatePary()
        {
            clientType = "1";
            clientCNameBenefit = "法定";
            identifyType = "01";
            appliPhone = "13888888888";
            email = "";
            postCode = "";
            homeAddress = "";
            selationship = "";
            identifyTypeBenefit = "";
            identifyNoBenfit = "";
            appliRelation = "";
        }
        /// <summary>
        /// *客户类型[1,:(1个人,2团体)]
        /// </summary>
        public string clientType { get; set; }
        /// <summary>
        /// *被保人姓名[50]
        /// </summary>
        public string clientCName { get; set; }
        /// <summary>
        /// *被保人证件类型[2]
        /// </summary>
        public string identifyType { get; set; }

        /// <summary>
        /// *被保人证件号码[30]
        /// </summary>
        public string identifyNo { get; set; }

        /// <summary>
        /// *被保人出生日期[10:1990-03-15]
        /// </summary>
        public string birthday { get; set; }

        /// <summary>
        /// *被保人[1:(1男,2女)]
        /// </summary>
        public string sex { get; set; }

        /// <summary>
        /// *被保人联系电话[11]
        /// </summary>
        public string appliPhone { get; set; }

        /// <summary>
        /// *职业[2],团单时该字段必传（与标的职业保持一致）
        /// </summary>
        public string insuredBusinessSource { get; set; }

        /// <summary>
        /// 被保人邮箱[50]
        /// </summary>
        public string email { get; set; }

        /// <summary>
        /// 邮政编码[6]
        /// </summary>
        public string postCode { get; set; }

        /// <summary>
        /// 被保人住址[200]
        /// </summary>
        public string homeAddress { get; set; }

        /// <summary>
        /// 受益人名称
        /// </summary>
        public string clientCNameBenefit { get; set; }

        /// <summary>
        /// 受益人与投保人关系
        /// </summary>
        public string selationship { get; set; }

        /// <summary>
        /// 受益人证件类型[2]
        /// </summary>
        public string identifyTypeBenefit { get; set; }

        /// <summary>
        /// 受益人证件号码[30]
        /// </summary>
        public string identifyNoBenfit { get; set; }

        /// <summary>
        /// 投保人与被保人关系[2]
        /// </summary>
        public string appliRelation { get; set; }

        /// <summary>
        /// 身份证设置证件信息
        /// </summary>
        /// <param name="idno"></param>
        public void setInsuredIdNo(string idno)
        {
            if (!CheckIdCard(idno)) return;
            identifyNo = idno;
            birthday = GetIdNoBirthday(idno,false);
            identifyType = "01";
            clientType = "1";
            sex = GetInNoSex(idno, false);
        }
    }
}
